const proto2Obj = (censor) => {
  var i = 0;
  
  return function(key, value) {
    if(i !== 0 && typeof(censor) === 'object' && typeof(value) == 'object' && censor == value) 
      return '[Circular]'; 
    
    if(i >= 29) // seems to be a harded maximum of 30 serialized objects?
      return '[Unknown]';
    
    ++i; // so we know we aren't using the original object anymore
    
    return value;  
  }
}

const handleUrl = (url) => {
  return url.indexOf('http://') > -1? `${url}` : `http://${url}`
}

export {
  proto2Obj,
  handleUrl
}
